<?php
$_action = 'apply';
if(!isset($action)){
    $action = $_action;
}
?>
<div class="table">
<table class="view">
    <tr>
        <td class="title" colspan="4"><?php __('Basic Information'); ?></td>
    </tr>
    <tr>
        <td class="key"><?php __('Job Title'); ?></td>
        <td class="value"><?php e($job['Job']['title']); ?></td>
        <td class="key"><?php __('Job Workplace'); ?></td>
        <td class="value"><?php e($job['Job']['workplace']); ?></td>
    </tr>
    <tr>
        <td class="key"><?php __('Published'); ?></td>
        <td class="value"><?php e($time->format($options['dateFormat'], $job['Job']['created'])); ?></td>
        <td class="key"><?php __('Owner Company'); ?></td>
        <td class="value">
            <?php e($html->link($company['Company']['name'],
                array('controller'=>'companies', 'action'=>'view',$company['Company']['id'])
            )); ?>
            <?php e($text->autoLink($company['Company']['website'],
                array('title'=>__('Click to visit the official website of the company', true),'class'=>'external')
            )); ?>
        </td>
    </tr>
    <tr>
        <td class="key"><?php __('Application Count'); ?></td>
        <td class="value" colspan="3"><?php e($job['Job']['students_job_count']); ?></td>
    </tr>
    <tr>
        <td class="title" colspan="4"><?php __('Detail Information'); ?></td>
    </tr>
    <tr>
        <td class="key"><?php __('Job Introduction'); ?></td>
        <td class="value" style="width: 80%" colspan="3"><?php e($job['Job']['introduction']); ?></td>
    </tr>
    <tr>
        <td class="key"><?php __('Job Requirement'); ?></td>
        <td class="value" style="width: 80%" colspan="3"><?php e($job['Job']['requirement']); ?></td>
    </tr>
</table>
<div class="actions">
    <ul>
    <?php if($user['group'] != 'student'): ?>
        <li><?php echo $html->link(__('Return', true), array('action' => 'index')); ?> </li>
        <li><?php echo $html->link(__('Edit Job', true), array('action' => 'edit', $job['Job']['id'])); ?> </li>
        <li><?php echo $html->link(__('New Job', true), array('action' => 'add')); ?> </li>
    <?php else: ?>
        <li>
        <?php if($action == 'apply'): ?>
            <?php echo $html->link(__('Apply this Job', true),
                array('controller'=>'students_jobs', 'action' => 'add', $job['Job']['id']),
                array('title' => __('Click to apply for this job', true), 'class' => 'link_apply_for_the_job attention'));
            ?>
        <?php else: ?>
            <?php echo $html->link(__('Cancel My Application for this job', true),
                array('controller'=>'students_jobs', 'action' => 'delete', $job['Job']['id']),
                array('title' => __('Cancel My Application for this job', true), 'class' => 'link_delete_student_job attention'));
            ?>
        <?php endif; ?>
        </li>
    <?php endif; ?>
    <br class="clear"/><br class="clear"/>
    </ul>
</div>
</div>